﻿using AllanXingCommonLibrary;
using cnBlogLibrary;
using cnBlogs.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace cnBlogs.ViewModel
{
    public class DynamicBackGoung : GetFeedsBase
    {
        public string Url { get; set; }

        protected override void Parse(string feed)
        {
            Group matches = Regex.Match(feed, "<img src=\"(?<rul>.*?)\">").Groups["rul"];
            Url = matches.Value;
        }

        protected override string GetUrl()
        {
            Random random = new Random();
            return string.Format(AppResource.WALLPAPER, random.Next(1401, 1445));
        }
    }
}
